<template>
  <el-dialog :modelValue="visiable" width="500" title="编辑" @closed="emit('close')" append-to-body>
    <el-form :model="towerEdit" ref="form" label-width="80px" :inline="false" class="-mb-5 mt-2" v-if="towerEdit">
      <el-form-item label="名称">
        <el-input v-model="towerEdit.tName" disabled>
          <template #append>
            <SignalTowerOne theme="outline" size="16" fill="#2980b9" />
          </template>
        </el-input>
      </el-form-item>
      <el-form-item label="铁塔类型">
        <el-select v-model="towerEdit.tStyle">
          <el-option v-for="item in styleOptions" :key="item.value" :label="item.value" :value="item.value" />
        </el-select>

        <!-- <el-input v-model="towerEdit.tStyle"></el-input> -->
      </el-form-item>
      <el-form-item label="塔型">
        <el-input v-model="towerEdit.tType">
          <template #append>
            <EiffelTower theme="outline" size="16" fill="#2980b9" />
          </template>
        </el-input>
      </el-form-item>
      <el-form-item label="转角">
        <el-input v-model="towerEdit.corner"></el-input>
      </el-form-item>
      <el-form-item label="高程">
        <el-input v-model="towerEdit.altitude">
          <template #append>
            <Local theme="outline" size="16" fill="#2980b9" />
          </template>
        </el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">更新</el-button>
        <el-button @click="emit('close')">取消</el-button>
      </el-form-item>
    </el-form>
  </el-dialog>
</template>

<script setup lang="ts">
import { towerModel } from '@/types/model'
import { EiffelTower, Local, SignalTowerOne } from '@icon-park/vue-next'

defineProps<{
  visiable: Boolean
  towerEdit?: towerModel
}>()
const emit = defineEmits(['close'])
const styleOptions = [{ value: '直线' }, { value: '耐张' }, { value: '牵引场' }, { value: '张力场' }]

const onSubmit = () => {}
</script>
